package com.zyy.memento.demo02;

/**
 * @Description: 类描述
 * @Author: zyy
 * @Date: 2023/08/06 16:40
 */
public class Client {
    public static void main(String[] args) {

        System.out.println("------------------大战Boss前----------------");
        GameRole gameRole = new GameRole();
        gameRole.iniState();
        gameRole.stateDisplay();

        //保存进度
        Memento memento = gameRole.saveState();
        RoleStateCaretaker roleStateCaretaker = new RoleStateCaretaker();
        roleStateCaretaker.setMemento(memento);
        System.out.println("------------------大战Boss后----------------");
        gameRole.fight();
        gameRole.stateDisplay();



        System.out.println("------------------满血复活后----------------");
        gameRole.recoverState(roleStateCaretaker.getMemento());
        gameRole.stateDisplay();
    }
}
